import request from "@/utils/request";

const api_name = "/backend";
const api_name1 = "/pd";
export default {

    assistCreateContract(user){
        return request({
            url: `/backend/assist/create-contract`,
            method: "post",
            data: user
        });
    },
    editAssistInfo(user){
        return request({
            url: `/backend/editAssistInfo`,
            method: "post",
            data: user
        });
    },
    updateCheckStatus(user){
        return request({
            url: `/backend/updateCheckStatus`,
            method: "post",
            data: user
        });
    },
    // /backend/listCheck
    listCheck(user) {
        return request({
            url: `/backend/listCheck`,
            method: "post",
            data: user
        });
    },
    listOrderStatus(user) {
        return request({
            url: `/backend/listOrderStatus`,
            method: "post",
            data: user
        });
    },
    binding(user) {
        return request({
            url: `/weixin/binding`,
            method: "get",
            params: user
        });
    },
    rolesAuthorityUpdate(user) {
        return request({
            url: `/rolesAuthority/update`,
            method: "post",
            data: user
        });
    },
    rolesAuthorityList(user) {
        return request({
            url: `/rolesAuthority/list`,
            method: "post",
            data: user
        });
    },
    roleAdd(user) {
        return request({
            url: `/role/add`,
            method: "post",
            data: user
        });
    },
    roleDelete(user) {
        return request({
            url: `/role/delete`,
            method: "post",
            data: user
        });
    },
    roleList(user) {
        console.log("user: ", user);
        return request({
            url: `/role/list`,
            method: "post",
            data: user
        });
    },
    roleUpdate(user) {
        return request({
            url: `/role//update`,
            method: "post",
            data: user
        });
    },

    getWxQrCode(user) {
        return request({
            url: `/weixin/getWxQrCode`,
            method: "get",
            data: user
        });
    },
    listProductForMenu(user) {
        return request({
            url: `${api_name}/listProductForMenu`,
            method: "post",
            data: user
        });
    },
    listProductForMenu2(user) {
        return request({
            url: `${api_name}/listProductForMenu2`,
            method: "post",
            data: user
        });
    },
    handoutProduct(user) {
        return request({
            url: `${api_name}/handoutProduct`,
            method: "post",
            data: user
        });
    },
    orderDetail(user) {
        return request({
            url: `${api_name}/orderDetail?id=` + user.id,
            method: "post"
                // data: user
        });
    },
    updateProductPurchase(user) {
        return request({
            url: `${api_name}/updateProductPurchase`,
            method: "post",
            data: user
        });
    },
    fullAssistdelete(user) {
        return request({
            url: `${api_name}/fullAssist/delete`,
            method: "post",
            data: user
        });
    },
    fullAssistupdate(user) {
        return request({
            url: `${api_name}/fullAssist/update`,
            method: "post",
            data: user
        });
    },
    fullAssist(user) {
        return request({
            url: `${api_name}/fullAssist`,
            method: "post",
            data: user
        });
    },
    getPageList(page, limit, searchObj) {
        return request({
            url: `${api_name}/${page}/${limit}`,
            method: "get",
            params: searchObj // url查询字符串或表单键值对
        });
    },
    getById(id) {
        return request({
            url: `${api_name}/get/${id}`,
            method: "get"
        });
    },

    objectLinkPdf(data) {
        return request({
            url: `/Object/objectLinkPdf`,
            headers: {
                "Content-Type": `multipart/form-data;boundary=${new Date().valueOf()}_${parseInt(
          Math.random() * 1000
        )}`
            },
            method: "post",
            data
        });
    },
    listAllOrder(user) {
        return request({
            url: `${api_name}/listAllOrder`,
            method: "post",
            data: user
        });
    },
    listProductForm(user) {
        return request({
            url: `${api_name}/listProductForm`,
            method: "post",
            data: user
        });
    },
    listOrder(user) {
        return request({
            url: `${api_name}/listOrder`,
            method: "post",
            data: user
        });
    },
    insertOrder(user) {
        return request({
            url: `${api_name}/insertOrder`,
            method: "post",
            data: user
        });
    },
    listProduct(user) {
        return request({
            url: `${api_name}/listProduct`,
            method: "post",
            data: user
        });
    },
    insertProduct(user) {
        return request({
            url: `${api_name}/insertProduct`,
            method: "post",
            data: user
        });
    },
    updateOrder(user) {
        return request({
            url: `${api_name}/updateOrder`,
            method: "post",
            data: user
        });
    },
    listProductItem(user) {
        return request({
            url: `${api_name}/listProductItem`,
            method: "post",
            data: user
        });
    },
    insertProductItem(user) {
        return request({
            url: `${api_name}/insertProductItem`,
            method: "post",
            data: user
        });
    },
    deleteOrder(user) {
        return request({
            url: `${api_name}/deleteOrder`,
            method: "post",
            data: user
        });
    },
    updateProduct(user) {
        return request({
            url: `${api_name}/updateProduct`,
            method: "post",
            data: user
        });
    },
    deleteProduct(user) {
        return request({
            url: `${api_name}/deleteProduct`,
            method: "post",
            data: user
        });
    },
    listAllProduct(user) {
        return request({
            url: `${api_name}/listAllProduct`,
            method: "post"
        });
    },
    deleteProductItem(user) {
        return request({
            url: `${api_name}/deleteProductItem`,
            method: "post",
            data: user
        });
    },
    listProductPurchase(user) {
        return request({
            url: `${api_name}/listProductPurchase`,
            method: "post",
            data: user
        });
    },
    insertProductPurchase(user) {
        return request({
            url: `${api_name}/insertProductPurchase`,
            method: "post",
            data: user
        });
    },
    listUser(user) {
        return request({
            url: `${api_name1}/listUser`,
            method: "post",
            data: user
        });
    },
    insertUser(user) {
        return request({
            url: `${api_name1}/insertUser`,
            method: "post",
            data: user
        });
    },
    updateUser(user) {
        return request({
            url: `${api_name1}/updateUser`,
            method: "post",
            data: user
        });
    },
    deleteProductPurchase(user) {
        return request({
            url: `${api_name}/deleteProductPurchase`,
            method: "post",
            data: user
        });
    },
    listImageFolder(user) {
        return request({
            url: `${api_name}/listImageFolder?productId=` + user.productId,
            method: "post"
        });
    },
    listFinancialOrder(user) {
        return request({
            url: `${api_name}/listFinancialOrder`,
            method: "post",
            data: user
        });
    },
    listFinancialOrderDetail(user) {
        return request({
            url: `${api_name}/listFinancialOrderDetail?orderId=` +
                user.orderId +
                "&page=" +
                user.page +
                "&limit=" +
                user.limit,
            method: "post"
                // data: user
        });
    },
    backendImport(data) {
        return request({
            url: `${api_name}/import`,
            method: "post",
            data
        });
    },
    uploadZip(data) {
        return request({
            url: `${api_name}/uploadFiles`,
            method: "post",
            data
        });
    },
    importProduct(data) {
        return request({
            url: `${api_name}/importProduct`,
            method: "post",
            data
        });
    },
    purchaseList(data) {
        return request({
            url: `${api_name}/purchase/list`,
            method: "post",
            data
        });
    },
    storagePurchasePut(data) {
        return request({
            url: `${api_name}/storage/purchase/put`,
            method: "post",
            data
        });
    },
    listPlateStorage(data) {
        return request({
            url: `${api_name}/storage/listPlateStorage`,
            method: "post",
            data
        });
    },
    purchaseApply(data) {
        return request({
            url: `${api_name}/storage/purchase/apply`,
            method: "post",
            data
        });
    },
    storageAdd(data) {
        return request({
            url: `${api_name}/storage/add`,
            method: "post",
            data
        });
    },
    storageOutbound(data) {
        return request({
            url: `${api_name}/storage/outbound`,
            method: "post",
            data
        });
    },
  purchaseApplyUpdate(data) {
        return request({
            url: `${api_name}/storage/purchase/apply/update`,
            method: "post",
            data
        });
    },
    // 外协列表
    fullAssistList(data) {
        return request({
            url: `${api_name}/fullAssist/list`,
            method: "post",
            data
        });
    },
    listDict(data) {
        return request({
            url: `${api_name}/listDict?type=1`,
            method: "post",
            data
        });
    },
    // 删除用户
    removeUser(data) {
        return request({
            url: `${api_name}/removeUser`,
            method: "post",
            data
        });
    },
    // backend/assist/arrive
    assistArrive(data) {
        return request({
            url: `${api_name}/assist/arrive`,
            method: "post",
            data
        });
    },
    assistCheck(data) {
        return request({
            url: `${api_name}/assist/check`,
            method: "post",
            data
        });
    },
    listPlateStorageRecord(data) {
        return request({
            url: `${api_name}/storage/listRecord`,
            method: "post",
            data
        });
    },
    // 供应商查询
    listManufacturer(data) {
        return request({
            url: `${api_name}/listManufacturer`,
            method: "post",
            data
        });
    },
    // 供应商新增
    insertManufacturer(data) {
        return request({
            url: `${api_name}/insertManufacturer`,
            method: "post",
            data
        });
    },
    // 更新供应商
    updateManufacturer(data) {
        return request({
            url: `${api_name}/updateManufacturer`,
            method: "post",
            data
        });
    },
    // 客户查询
    listCustomer(data) {
        return request({
            url: `${api_name}/listCustomer`,
            method: "post",
            data
        });
    },
    // 客户新增
    insertCustomer(data) {
        return request({
            url: `${api_name}/insertCustomer`,
            method: "post",
            data
        });
    },
    // 更新客户
    updateCustomer(data) {
        return request({
            url: `${api_name}/updateCustomer`,
            method: "post",
            data
        });
    },
    // 采购记录列表
    purchaseListRecord(data) {
        return request({
            url: `${api_name}/purchase/list-record`,
            method: "post",
            data
        });
    },
    // 品检管理记录列表
    qualityListRecord(data) {
        return request({
            url: `${api_name}/quality/list-record`,
            method: "post",
            data
        });
    },

    purchaseApplyImport(data) {
        return request({
            url: `/backend/storage/purchase/apply/import`,
            method: "post",
            data
        });
    },

    listProject(data) {
        return request({
            url: `/backend/listProject`,
            method: "post",
            data
        });
    },

    listCheckDetail(params) {
        return request({
            url: `/backend/listCheckDetail`,
            method: "post",
            params
        });
    },

    // 编排工艺
    arrangeProduct(data) {
        return request({
            url: `/backend/arrangeProduct`,
            method: "post",
            data
        });
    },

    // 工艺名称列表
    arrangeNameList() {
        return request({
            url: `backend/listDict?type=2`,
            method: "post"
        });
    },

    // 删除工艺
    deleteArrangeProduct(data) {
        return request({
            url: `/backend/deleteArrangeProduct`,
            method: "post",
            data
        });
    },
  commonListDict(type) {
    return request({
      url: `/backend/listDict?type=`+type,
      method: "post"
    });
  },
  // 修改字典
  saveListDict(data) {
    return request({
      url: `backend/saveListDict`,
      method: "post",
      data
    });
  },
  // 清除全部数据
  clearData() {
    return request({
      url: `backend/removeData`,
      method: "post"
    });
  },
  // 清除全部数据
  resectPas(data) {
    return request({
      url: `backend/updateUser`,
      method: "post",
      data
    });
  },
  // 清除全部数据
  getDispatchUser(data) {
    return request({
      url: `pd/listUser`,
      method: "post",
      data
    });
  },
  // 清除全部数据
  saveDispatch(data) {
    return request({
      url: `backend/assign `,
      method: "post",
      data
    });
  },
// 清除全部数据
  getDepartmentList(id) {
    return request({
      url: `/message/dept/user?messageId=`+id,
      method: "get"
    });
  },
  // 清除全部数据
  getMessageList(data) {
    return request({
      url: `/message/page`,
      method: "post",
      data
    });
  },
  // 清除全部数据
  updateMessage(data) {
    return request({
      url: `/message/update`,
      method: "post",
      data
    });
  },
  // 清除全部数据
  updateMessageConfiguration(data) {
    return request({
      url: `/message/update/configuration`,
      method: "post",
      data
    });
  },
  // 清除全部数据
  getMessageLogCount() {
    return request({
      url: `/message/log/count`,
      method: "get"
    });
  },
  // 清除全部数据
  getMessageLogList(data) {
    return request({
      url: `/message/log/page`,
      method: "post",
      data
    });
  },
  // 清除全部数据
  updateMessageRead(data) {
    return request({
      url: `/message/log/update`,
      method: "post",
      data
    });
  },
  // 清除全部数据
  getMessageConfig() {
    return request({
      url: `/message/config`,
      method: "get"
    });
  },
  // 清除全部数据
  getPurchaseDetail(id) {
    return request({
      url: `backend/storage/purchase/detail?id=`+id,
      method: "post"
    });
  },
  // 清除全部数据
  editPurchase(data) {
    return request({
      url: `backend/storage/purchase/edit`,
      method: "post",
      data
    });
  },
  // 清除全部数据
  getOrderCode(key) {
    return request({
      url: `/backend/getOrderCode?key=`+key,
      method: "post"
    });
  },
  // 清除全部数据
  getProductImportByOrder(key,innerCode) {
    return request({
      url: `/backend/getProductImportByOrder?key=${key}&innerCode=${innerCode}`,
      method: "post"
    });
  },
};
